package com.osgix.common.widget.extTree;

import java.util.ArrayList;
import java.util.List;

import com.osgix.common.utils.JsonUtils;

public class ExtTreeUtilTest {
	public static void main(String[] args) {
		List<ExtTreeNode> nodeList = new ArrayList<ExtTreeNode>();

		ExtTreeNode node1 = new ExtTreeNode();
		ExtTreeNode node2 = new ExtTreeNode();
		ExtTreeNode node3 = new ExtTreeNode();
		ExtTreeNode node4 = new ExtTreeNode();
		ExtTreeNode node5 = new ExtTreeNode();
		ExtTreeNode node6 = new ExtTreeNode();

		node3.setId("3");
		node3.setText("节点3");

		node4.setId("4");
		node4.setText("节点4");

		node5.setId("5");
		node5.setText("节点5");

		node6.setId("6");
		node6.setText("节点6");

		node1.setId("1");
		node1.setText("节点1");
		node1.setLeaf(false);

		node2.setId("2");
		node2.setText("节点2");
		node2.setLeaf(false);

		nodeList.add(node1);
		nodeList.add(node2);

		String extTreeStr = JsonUtils.getArrayJson(nodeList);
		System.out.println(extTreeStr);

	}

}
